<template>
   
   <div class="parentWrapper">
       <Parent :parentdata='parentdata.parent' v-if="parentdata.parent"></Parent>
       <div class="info">
           <div class="author">
               {{parentdata.user.nickname}}
           </div>
           <div class="date">{{parentdata.user.create_date.split('T')[0]}}</div>
           <div class="rlyBtn" @click="callRly">回复</div>
       </div>
       <div class="ParentContent">{{parentdata.content}}</div>   
       </div>
</template>

<script>
import Bus from '../../utis/bus'
export default {
    props:['parentdata'],
    name:'Parent',
    methods:{
        callRly(){
            Bus.$emit('callRly',this.parentdata.id)
        }
    }

}
</script>

<style lang="less">
.parentWrapper{
  border:1px solid #cccccc;
  padding:10/360*100vw;
  .info{
      display: flex;
      align-items: center;
      .author{
          font-size: 14px;
      }
      .date{
          flex: 1;
          margin-left:10/360*100vw;
          font-size: 12px;
      }
      .rlyBtn{
          font-size: 14/360*100vw;
          color:#888;
      }
  }
  .ParentContent{
      padding: 10/360*100vw;
      color: #333;
  }
}
</style>